package com.dt76.smallloanbackendservice.service.hzp.Impl;

import com.dt76.smallloanbackendservice.mapper.hzp.HLoanMaterialMapper;
import com.dt76.smallloanbackendservice.pojo.hzp.HLoanMaterial;
import com.dt76.smallloanbackendservice.service.hzp.HLoanMaterialService;
import com.dt76.smallloanbackendservice.utils.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class HLoanMaterialServiceImpl implements HLoanMaterialService {
    @Autowired
    private HLoanMaterialMapper loanMaterialMapper;
    @Override
    public List<HLoanMaterial> qryAllHLMM() {
        return loanMaterialMapper.qryAllHLMM();
    }

    @Override
    public Page qryPageHLMM(Page page) {
        page.setTotalCount(loanMaterialMapper.qryCount());
        page.setRows(loanMaterialMapper.qryPageHLMM((page.getPageIndex()-1)*page.getPageSize(),
                page.getPageSize()));
        return page;
    }

//    @Override
//    public void addNewHLMM(HLoanMaterial hLoanMaterial) {
//        loanMaterialMapper.insert(hLoanMaterial);
//    }
//
//    @Override
//    public HLoanMaterial getById(int materialId) {
//        return loanMaterialMapper.findOne(materialId);
//    }

}
